package com.hixtrip.sample.domain.inventory.repository;

/**
 *
 */
public interface InventoryRepository {

    Integer decrementSkuInventory(String skuId);
    /**
     * 预占库存加N,可售库存减N
     * @param skuId
     * @param quantity
     * @return
     */
    boolean reservePreemptively(String skuId, Long quantity);
    /**
     * 预占库存减N，已售库存加N
     * @return boolean
     */
    boolean commitPreemptiveReservation(String skuId, Long quantity);
}
